﻿using System;

namespace NeuralLib.ActivationFunction
{
    [Serializable]
    public class LinearFunction:IActivationFunction
    {
         private double _alpha = 0.5;

        public double Alpha
        {
            get { return _alpha; }
            set { _alpha = value; }
        }

        public LinearFunction() { }

        public LinearFunction(double alpha)
        {
            _alpha = alpha;
        }

        public double Derivative(double x)
        {
            return _alpha;
        }

        public double Derivative2(double y)
        {
            return _alpha;
        }

        public double Function(double x)
        {
            return _alpha * x;
        }
    }
}
